#pragma once

#include <QMainWindow>
#include <QTimer>
#include "Board.h"

QT_BEGIN_NAMESPACE
namespace Ui {
    class MainWindow;
}
QT_END_NAMESPACE

class Game : public QMainWindow {
Q_OBJECT

public:
    explicit Game(QWidget *parent = nullptr);

    ~Game() override;

private slots:

    void onGameOver(bool win);

    void onUpdateRemain(int remain);

    void onUpdateHover(bool enter);

private:
    void reset(int r, int c, int n);

    void restart();

    void updateTime();

    QString getTimeStr();

    void customDifficulty();

    Ui::MainWindow *ui;
    Board *board;
    QTimer timer;
    int time = 0;
};
